<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三列式布局</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            outline: 0;
        }

        .left {
            float: left;
        }

        .right {
            float: right;
        }

        /* 伪元素 是 行内元素 */
        .clearfix::after {
            content: '';
            display: block;
            clear: both;
        }

        .green {
            background-color: green;
        }

        .orange {
            background-color: orange;
        }

        .w150 {
            width: 150px;
            height: 150px;
        }

        main {
            height: 100px;
        }

        .grail {
            /* 圣杯式布局 给aside留白*/
            padding: 0 150px;
        }

        .grail main {
            float: left;
            width: 100%;
        }

        .grail .left {
            margin-left: -100%;
            position: relative;
            left: -150px;
        }

        .grail .right {
            float: left;
            /*覆盖掉了右浮*/
            margin-left: -150px;
            position: relative;
            /* left: 150px; */
            right: -150px;
        }
    </style>
</head>

<body>
    <div class="layout">
        <h4>方法一：圣杯战争</h4>
        <section class="grail clearfix">
            <!-- 自适应 -->
            <main class="green">main</main>
            <aside class="w150 left orange">aside</aside>
            <aside class="w150 right orange">aside</aside>
        </section>
    </div>
</body>

</html>